<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
			    xmlns:ui="http://java.sun.com/jsf/facelets"
			    xmlns:h="http://java.sun.com/jsf/html"
			    xmlns:f="http://java.sun.com/jsf/core"    
			    template="./template/template_login.xhtml">
    
    <ui:define name="title">
        Registrar Proveedor
    </ui:define>
    
    <ui:define name="content">    				
			    		    			    	
 	<div class="box box-50 altbox">
		<h:outputScript library="js" name="jquery-1.7.1.min.js" target="head" />
		<h:outputScript library="js" name="jquery.maskedinput-1.3.min.js" target="head" />
		<script>
			jQuery(function($){		        	
			   $("#agregarProveedorForm\\:telcasaId").mask("(999) 999-9999");
			   $("#agregarProveedorForm\\:telcelId").mask("(999) 999-9999");
		   });
		</script>
		<div class="boxin">
			<div class="header">
				<h3>Proveedores</h3>
			</div>
			<h:form id="agregarProveedorForm" styleClass="fields"> 	
				<fieldset class="last">
					<f:event listener="#{suppliersBean.validateForm}" type="postValidate" />					
					<legend><strong>Agregar Proveedor</strong></legend>
					<h:messages id="messages" errorClass="msg msg-error" infoClass="msg msg-info" />
					
					<h:outputLabel value="Nombre" />
					<h:inputText id="nombreId" value="#{suppliersBean.suppliersView.name}"  onfocus="this.select();" />
					
					<h:outputLabel value="Domicilio" />					
					<h:inputText id="domicilioId" value="#{suppliersBean.suppliersView.address}"  onfocus="this.select();" />
										
					<h:outputLabel value="Tel Casa" />
				    <h:inputText id="telcasaId" value="#{suppliersBean.suppliersView.phoneNumber}"  onfocus="this.select();" />
					
					<h:outputLabel value="Tel Celular" />
					<h:inputText id="telcelId" value="#{suppliersBean.suppliersView.cellPhoneNumber}"  onfocus="this.select();" />	
					
					<div class="sep">
						<h:commandButton id="submit" styleClass="button altbutton" value="Guardar" action="#{suppliersBean.addSupplierAction}" /> &nbsp;&nbsp;
		      			<h:commandButton id="back" styleClass="button" value="Regresar" action="#{suppliersBean.goBack}" immediate="true" />										
					</div>
			</fieldset>
			</h:form>
		</div>
	</div>    			    			    			    				    												
	</ui:define>
    
</ui:composition>